﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JSONDB.Validation
{
    public class ItemValidator: AbstractValidator<Item>
    {
        public ItemValidator() {
            RuleFor(x => x.value).NotEmpty().WithMessage("标签变量名不能为空");
            RuleFor(x => x.name).NotEmpty().WithMessage("标签名不能为空"); 
            RuleFor(x => x.groupname).NotEmpty().WithMessage("分组名不能为空");
            RuleFor(x => x.opcname).NotEmpty().WithMessage("opcname不能为空");
        }
    }
}
